#include "msgserver.h"
#include "msgsocket.h"

MsgServer::MsgServer(int port, EventLoop *loop, ThreadPool *pool)
{
    m_server = new TcpServer(port, loop,pool);
    m_server->createNewConnectCallback(
                std::bind(&MsgServer::newTcpConnection, this, std::placeholders::_1));
}

MsgServer::~MsgServer()
{
    delete m_server;
}

void MsgServer::startListen(void)
{
    m_server->listen();
}

void MsgServer::newTcpConnection(TcpSocket *socket)
{
    MsgSocket *msgSocket = new MsgSocket(socket);
}
